package accounts

import (
	"gitee.com/djaf/my-certs/app/data/dxo"
	"gitee.com/djaf/my-certs/app/data/entity"
	"gorm.io/gorm"
)

// DAO ...
type DAO interface {
	Insert(db *gorm.DB, item *entity.Account) (*entity.Account, error)

	Update(db *gorm.DB, id dxo.AccountID, fn func(item *entity.Account)) (*entity.Account, error)

	Remove(db *gorm.DB, id dxo.AccountID) error

	Find(db *gorm.DB, id dxo.AccountID) (*entity.Account, error)

	FindBySelector(db *gorm.DB, sel int64) (*entity.Account, error)

	List(db *gorm.DB, q *Query) ([]*entity.Account, error)
}
